<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<link rel="stylesheet" type="text/css"
			href="themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="themes/icon.css">

		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
		<fmt:setBundle basename="messages" />
		<title><fmt:message key="title" />
		</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

	</head>

	<body>
		<form action="SearchOrderDetail.do" method="post">
			<table border=1 width="80%" align="center" height="100%">
				<tr>
					<td colspan=2>
						<jsp:include page="header.jsp"></jsp:include>
					</td>
				</tr>
				<tr>
					<td width="20%">

						<c:choose>
							<c:when test="${employee.roleid==1}">
								<jsp:include page="adminfunc.jsp"></jsp:include>
							</c:when>
							<c:otherwise>
								<jsp:include page="mechnicfunc.jsp"></jsp:include>
							</c:otherwise>
						</c:choose>

					</td>
					<td valign="top">

						<table border=1 cellspacing='2' cellpadding='2'>

							<tr>

								<td>

									<a href="GetTransactionHistory.do">List Details Of All
										Orders</a>
								</td>

								<td>

									Search By Order Number:
									<input type="text" name="ordernum">
									<input type="submit" value="submit">

								</td>

								<td>
								 	Start Date<input id="stardate" class="easyui-datebox" required="true" name="startdate"></input>

								</td>
								<td>
								 	End Date<input id="enddate" class="easyui-datebox" required="true" name="enddate"></input>

								</td>
								<td>
								<input type="submit" value="submit">
								</td>

							</tr>

							<c:forEach var="orderdetail" items="${requestScope.list}"
								varStatus="listpro">
								<tr>
									<td>
										Order Number:${orderdetail.ordernum}
									</td>

									<td>
										Order Date:${orderdetail.orderdate}
									</td>
									<td>
										Done by:${orderdetail.employeename}
									</td>
								</tr>
								<tr>
									<td>
										Parts Information|
										<table>
											<tr>
												<th>
												</th>
												<th>
													Part NO.|
												</th>
												<th>
													UnitPrice|
												</th>

												<th>
													Quantity
												</th>
											</tr>
											<c:forEach var="productdetail" items="${orderdetail.product}"
												varStatus="listpro">
												<tr>
													<td>

													</td>
													<td>
														${productdetail.productnum}
													</td>
													<td>
														${productdetail.unitprice}
													</td>

													<td>
														${productdetail.quantity}
													</td>

												</tr>

											</c:forEach>
										</table>
									</td>
								</tr>
							</c:forEach>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
